// import 'dart:io';
import 'dart:ui';

import 'package:flutter/material.dart';

import 'Login.dart';
import 'Register.dart';
// import 'Register.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // theme: ThemeData(
      //   primarySwatch: Colors.blue ,
      //   visualDensity: VisualDensity.adaptivePlatformDensity,
      //   buttonTheme: ButtonThemeData(
      //     minWidth: 0,
      //     // height: 0,
      //     padding: EdgeInsets.zero,
      //   ),
      // ),
      debugShowCheckedModeBanner: false,
      title: 'hello world',
      home: Scaffold(
        // appBar: AppBar(
        //   elevation: 0.0,
        //   title: Text(
        //     '注册',
        //     style: TextStyle(color: Colors.white),
        //   ),
        //   backgroundColor: Color(0xFFFF502E),
        //   centerTitle: true,
        // ),
        body: Center(
          child: Container(
            child: Register(),
          ),
        ),
      ),
    );
  }
}

// class MyList extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     return ListView(
//       scrollDirection: Axis.horizontal,
//       children: <Widget>[
//         Container(
//           width: 200.0,
//           color: Colors.red,
//         ),
//         Container(
//           width: 200.0,
//           color: Colors.lightBlue,
//         ),
//         Container(
//           width: 200.0,
//           color: Colors.pink,
//         ),
//         Container(
//           width: 200.0,
//           color: Colors.purple,
//         ),
//       ],
//     );
//   }
// }

// class TutorialHome extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     //Scaffold是Material中主要的布局组件.
//     return new Scaffold(
//       // appBar: new AppBar(
//       //   leading: new IconButton(
//       //     icon: new Icon(Icons.menu),
//       //     tooltip: 'Navigation menu',
//       //     onPressed: null,
//       //   ),
//       //   title: new Text('易货宝'),
//       //   actions: <Widget>[
//       //     new IconButton(
//       //       icon: new Icon(Icons.search),
//       //       tooltip: 'Search',
//       //       onPressed: null,
//       //     ),
//       //   ],
//       // ),
//       //body占屏幕的大部分
//       // body: new Center(
//       //   child: new Text('Hello, world!'),

//       // ),
//       body: ListView(
//         children: <Widget>[
//           Image.network(
//             'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F015e225a65ed23a8012113c72cc4c7.gif&refer=http%3A%2F%2Fimg.zcool.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1626505451&t=3e5c162e5838154a42961c2841b07629',
//             fit: BoxFit.fill,
//             height: 735.0,
//           ),
//           Image.network(
//             'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F01ecb4596af899a8012193a3b718e8.jpg&refer=http%3A%2F%2Fimg.zcool.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1626505451&t=62469f20815b59b6e9be9dac24a93a9c',
//             fit: BoxFit.fill,
//             height: 770.0,
//           ),
//           ListTile(
//             leading: Icon(Icons.account_balance_wallet_outlined),
//             title: Text('钱包'),
//           ),
//           ListTile(
//             leading: Icon(Icons.account_box_rounded),
//             title: Text('会员'),
//           ),
//           ListTile(
//             leading: Icon(Icons.add_chart_outlined),
//             title: Text('统计'),
//           ),
//           ListTile(
//             leading: Icon(Icons.accessibility_rounded),
//             title: Text('活动'),
//           ),
//           ListTile(
//             leading: Icon(Icons.photo_camera_front_outlined),
//             title: Text('活动'),
//           ),
//           ListTile(
//             leading: Icon(Icons.access_time_filled_rounded),
//             title: Text('时间'),
//           )
//         ],
//       ),
//       // floatingActionButton: new FloatingActionButton(
//       //   tooltip: 'Add', // used by assistive technologies
//       //   child: new Icon(Icons.add),
//       //   onPressed: null,
//       // ),
//     );
//   }
// }

// class TutorialHome extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     //Scaffold是Material中主要的布局组件.
//     return new Scaffold(
//       body: ListView(
//         children: <Widget>[
//           TextField(
//             keyboardType: TextInputType.phone,
//             maxLines: 1,
//             autofocus: false,
//             cursorColor: Colors.blue,
//             maxLength: 11,
//             // maxLengthEnforced: true,
//             // focusNode: phoneFocusNode,
//             decoration: InputDecoration(
//               hintText: "请输入用户名/手机号",
//               labelText: "手机号",
//               prefixIcon: Icon(Icons.phone),
//               // 未获得焦点下划线设为灰色
//               enabledBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.grey),
//               ),
//               //获得焦点下划线设为蓝色
//               focusedBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.blue),
//               ),
//             ),
//           ),
//           TextField(
//             keyboardType: TextInputType.text,
//             obscureText: true,
//             maxLines: 1,
//             autofocus: false,
//             cursorColor: Colors.blue,
//             // focusNode: passwordFocusNode,
//             decoration: InputDecoration(
//               hintText: "请输入密码",
//               labelText: "密码",
//               prefixIcon: Icon(Icons.vpn_key),
//               // 未获得焦点下划线设为灰色
//               enabledBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.grey),
//               ),
//               //获得焦点下划线设为蓝色
//               focusedBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.blue),
//               ),
//             ),
//           ),
//           Padding(
//             padding: EdgeInsets.all(16),
//             child: RaisedButton(
//                 child: Text(
//                   "开始登录",
//                 ),
//                 onPressed: () {
//                   //开始登录
//                 }),
//           )
//         ],
//       ),
//       // floatingActionButton: new FloatingActionButton(
//       //   tooltip: 'Add', // used by assistive technologies
//       //   child: new Icon(Icons.add),
//       //   onPressed: null,
//       // ),
//     );
//   }
// }

// class Register extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     Size size = MediaQuery.of(context).size;
//     //Scaffold是Material中主要的布局组件.
//     return new Scaffold(
//       body: ListView(
//         children: <Widget>[
//           Container(
//             child: Image.asset(
//               'image/yhb.png',
//               height: 100.0,
//             ),
//             padding: const EdgeInsets.only(top: 50.0, bottom: 20.0),
//           ),
//           TextField(
//             keyboardType: TextInputType.phone,
//             maxLines: 1,
//             autofocus: false,
//             cursorColor: Colors.blue,
//             maxLength: 11,
//             // maxLengthEnforced: true,
//             // focusNode: phoneFocusNode,
//             decoration: InputDecoration(
//               hintText: "请输入手机号码",
//               labelText: "手机号",
//               prefixIcon: Icon(Icons.phone),
//               // 未获得焦点下划线设为灰色
//               enabledBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.grey),
//               ),
//               //获得焦点下划线设为蓝色
//               focusedBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.blue),
//               ),
//             ),
//           ),
//           TextField(
//             keyboardType: TextInputType.text,
//             obscureText: true,
//             maxLines: 1,
//             autofocus: false,
//             cursorColor: Colors.blue,
//             // focusNode: passwordFocusNode,
//             decoration: InputDecoration(
//               hintText: "请输入密码",
//               labelText: "密码",
//               prefixIcon: Icon(Icons.vpn_key),
//               // 未获得焦点下划线设为灰色
//               enabledBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.grey),
//               ),
//               //获得焦点下划线设为蓝色
//               focusedBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.blue),
//               ),
//             ),
//           ),
//           Padding(
//             padding: EdgeInsets.only(top: 18.0),
//             child: TextField(
//               keyboardType: TextInputType.text,
//               obscureText: true,
//               maxLines: 1,
//               autofocus: false,
//               cursorColor: Colors.blue,
//               // focusNode: passwordFocusNode,
//               decoration: InputDecoration(
//                 hintText: "请输入密码",
//                 labelText: "确认密码",
//                 prefixIcon: Icon(Icons.vpn_key),
//                 // 未获得焦点下划线设为灰色
//                 enabledBorder: UnderlineInputBorder(
//                   borderSide: BorderSide(color: Colors.grey),
//                 ),
//                 //获得焦点下划线设为蓝色
//                 focusedBorder: UnderlineInputBorder(
//                   borderSide: BorderSide(color: Colors.blue),
//                 ),
//               ),
//             ),
//           ),
//           Padding(
//             padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
//             child: FlatButton(
//               // color: Colors.red,
//               color: Color(0xFFFF502E),
//               highlightColor: Colors.blue[700],
//               colorBrightness: Brightness.dark,
//               splashColor: Colors.grey,
//               child: Text("注册"),
//               // shape: RoundedRectangleBorder(
//               //     borderRadius: BorderRadius.circular(20.0)),
//               onPressed: () {
//                 // Navigator.push(
//                 //     context,
//                 //     MaterialPageRoute(
//                 //         builder: (context) => new SecondScreen()));
//               },
//             ),
//           ),
//           Container(
//             child: Row(
//               children: <Widget>[
//                 Text('已有账号？'),
//                 FlatButton(
//                   materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//                   padding: EdgeInsets.all(0),
//                   onPressed: () {
//                     Navigator.push(
//                         context,
//                         MaterialPageRoute(
//                             builder: (context) => new SecondScreen()));
//                   },
//                   child: Text(
//                     "前往登录",
//                     style: TextStyle(color: Color(0xFFFF502E)),
//                   ),
//                 ),
//                 Padding(padding: const EdgeInsets.only(left: 160.0)),
//                 FlatButton(
//                   materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//                   onPressed: () {
//                     Navigator.push(
//                       context,
//                       MaterialPageRoute(
//                         builder: (context) => new VerifyCode(),
//                       ),
//                     );
//                   },
//                   child: Text(
//                     '短信验证码',
//                     style: TextStyle(
//                       color: Color(0xFFFF502E),
//                     ),
//                   ),
//                 )
//               ],
//             ),
//             margin: EdgeInsets.only(left: 15.0),
//           ),
//           Container(
//             child: SwitchAndCheckBoxTestRoute(),
//           )
//           // child: SwitchAndCheckBoxTestRoute(),
//         ],
//       ),
//       // floatingActionButton: new FloatingActionButton(
//       //   tooltip: 'Add', // used by assistive technologies
//       //   child: new Icon(Icons.add),
//       //   onPressed: null,
//       // ),
//     );
//   }
// }

// class Login extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     Size size = MediaQuery.of(context).size;
//     //Scaffold是Material中主要的布局组件.
//     return new Scaffold(
//       body: ListView(
//         children: <Widget>[
//           Container(
//             child: Image.asset(
//               'image/yhb.png',
//               height: 100.0,
//             ),
//             padding: const EdgeInsets.only(top: 50.0, bottom: 20.0),
//           ),
//           TextField(
//             keyboardType: TextInputType.phone,
//             maxLines: 1,
//             autofocus: false,
//             cursorColor: Colors.blue,
//             maxLength: 11,
//             // maxLengthEnforced: true,
//             // focusNode: phoneFocusNode,
//             decoration: InputDecoration(
//               hintText: "请输入手机号码",
//               labelText: "手机号",
//               prefixIcon: Icon(Icons.phone),
//               // 未获得焦点下划线设为灰色
//               enabledBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.grey),
//               ),
//               //获得焦点下划线设为蓝色
//               focusedBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.blue),
//               ),
//             ),
//           ),
//           TextField(
//             keyboardType: TextInputType.text,
//             obscureText: true,
//             maxLines: 1,
//             autofocus: false,
//             cursorColor: Colors.blue,
//             // focusNode: passwordFocusNode,
//             decoration: InputDecoration(
//               hintText: "请输入密码",
//               labelText: "密码",
//               prefixIcon: Icon(Icons.vpn_key),
//               // 未获得焦点下划线设为灰色
//               enabledBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.grey),
//               ),
//               //获得焦点下划线设为蓝色
//               focusedBorder: UnderlineInputBorder(
//                 borderSide: BorderSide(color: Colors.blue),
//               ),
//             ),
//           ),
//           Padding(
//             padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
//             child: FlatButton(
//               color: Colors.red,
//               highlightColor: Colors.blue[700],
//               colorBrightness: Brightness.dark,
//               splashColor: Colors.grey,
//               child: Text("登录"),
//               // shape: RoundedRectangleBorder(
//               //     borderRadius: BorderRadius.circular(20.0)),
//               onPressed: () {
//                 Navigator.push(
//                   context,
//                   MaterialPageRoute(
//                     builder: (context) => new SecondScreen(),
//                   ),
//                 );
//               },
//             ),
//           ),
//           Container(
//             child: Row(
//               children: <Widget>[
//                 Text('没有账号？'),
//                 FlatButton(
//                   materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//                   padding: EdgeInsets.all(0),
//                   onPressed: () {
//                     Navigator.push(
//                         context,
//                         MaterialPageRoute(
//                             builder: (context) => new Register()));
//                   },
//                   child: Text(
//                     "前往注册",
//                     style: TextStyle(color: Color(0xFFFF502E)),
//                   ),
//                 ),
//                 Padding(
//                     padding: EdgeInsets.only(
//                   left: 170.0,
//                 )),
//                 FlatButton(
//                   onPressed: () {
//                     Navigator.push(
//                       context,
//                       MaterialPageRoute(
//                         builder: (context) => new EditPassword(),
//                       ),
//                     );
//                   },
//                   child: Text(
//                     '忘记密码？',
//                     style: TextStyle(
//                       color: Color(0xFFFF502E),
//                     ),
//                   ),
//                 )
//               ],
//             ),
//             margin: EdgeInsets.only(left: 15.0),
//           ),
//           Container(
//             child: SwitchAndCheckBoxTestRoute(),
//           ),
//           Container(
//             child: Center(
//               child: Text('其他方式登录'),
//             ),
//             padding: const EdgeInsets.only(top: 10.0, bottom: 30.0),
//           ),
//           Row(
//             children: <Widget>[
//               Image.asset('image/QQ.png', height: 45.0),
//               Padding(padding: EdgeInsets.all(15.0)),
//               Image.asset('image/weibo.png', height: 45.0),
//               Padding(padding: EdgeInsets.all(15.0)),
//               Image.asset('image/wechat.png', height: 45.0),
//             ],
//             mainAxisAlignment: MainAxisAlignment.center,
//           ),
//           Container(
//             child: Center(
//               child: FlatButton(
//                 onPressed: () {
//                   Navigator.push(
//                     context,
//                     MaterialPageRoute(
//                       builder: (context) => new MainPage(),
//                     ),
//                   );
//                 },
//                 child: Text(
//                   '体验一下跳过登录',
//                   style: TextStyle(color: Colors.grey[400]),
//                 ),
//               ),
//             ),
//             padding: const EdgeInsets.only(top: 30.0, bottom: 30.0),
//           ),
//           // child: SwitchAndCheckBoxTestRoute(),
//         ],
//       ),
//     );
//   }
// }

class SwitchAndCheckBoxTestRoute extends StatefulWidget {
  @override
  _SwitchAndCheckBoxTestRouteState createState() =>
      new _SwitchAndCheckBoxTestRouteState();
}

class _SwitchAndCheckBoxTestRouteState
    extends State<SwitchAndCheckBoxTestRoute> {
  bool _checkboxSelected = true; //维护复选框状态
  @override
  Widget build(BuildContext context) {
    return new Row(
      children: <Widget>[
        Checkbox(
          value: _checkboxSelected,
          activeColor: Colors.red, //选中时的颜色
          onChanged: (value) {
            setState(() {
              _checkboxSelected = value!;
            });
          },
          shape: CircleBorder(),
        ),
        Container(
          child: new Text(
            '同意用户协议与隐私政策',
            style: new TextStyle(color: Color(0xff797979)),
          ),
        ),
      ],
    );
  }
}

class SecondScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.0,
        title: Text(
          '登录',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Color(0xFFFF502E),
        centerTitle: true,
      ),
      body: Center(
        child: Login(),
      ),
    );
  }
}

class VerifyCode extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.0,
        title: Text(
          '验证码登录',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Color(0xFFFF502E),
        centerTitle: true,
      ),
      body: Center(
        child: VerifyPage(),
      ),
    );
  }
}

class VerifyPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    //Scaffold是Material中主要的布局组件.
    return new Scaffold(
      body: ListView(
        children: <Widget>[
          Container(
            child: Image.asset(
              'image/yhb.png',
              height: 100.0,
            ),
            padding: const EdgeInsets.only(top: 50.0, bottom: 20.0),
          ),
          Stack(
            children: <Widget>[
              TextField(
                keyboardType: TextInputType.phone,
                maxLines: 1,
                autofocus: false,
                cursorColor: Colors.blue,
                maxLength: 11,
                // maxLengthEnforced: true,
                // focusNode: phoneFocusNode,
                decoration: InputDecoration(
                  hintText: "请输入手机号码",
                  labelText: "手机号",
                  prefixIcon: Icon(Icons.phone),
                  // 未获得焦点下划线设为灰色
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.grey),
                  ),
                  //获得焦点下划线设为蓝色
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.blue),
                  ),
                ),
              ),
              Positioned(
                child: FlatButton(
                  onPressed: () {},
                  child: Text(
                    '发送验证码',
                    style: TextStyle(
                      color: Color(0xFFFF502E),
                    ),
                  ),
                ),
                top: 15.0,
                right: 15.0,
              )
            ],
          ),
          TextField(
            keyboardType: TextInputType.text,
            obscureText: true,
            maxLines: 1,
            autofocus: false,
            cursorColor: Colors.blue,
            // focusNode: passwordFocusNode,
            maxLength: 6,
            decoration: InputDecoration(
              hintText: "请输入验证码",
              labelText: "验证码",
              prefixIcon: Icon(Icons.vpn_key),
              // 未获得焦点下划线设为灰色
              enabledBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.grey),
              ),
              //获得焦点下划线设为蓝色
              focusedBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.blue),
              ),
            ),
          ),
          Padding(
            padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
            child: FlatButton(
              color: Colors.red,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              child: Text("登录"),
              // shape: RoundedRectangleBorder(
              //     borderRadius: BorderRadius.circular(20.0)),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => new SecondScreen(),
                  ),
                );
              },
            ),
          ),
          Container(
            child: SwitchAndCheckBoxTestRoute(),
          ),
        ],
      ),
    );
  }
}

class MainPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.0,
        title: Text(
          '大地影院',
          style: TextStyle(color: Colors.white),
        ),
        automaticallyImplyLeading: false,
        backgroundColor: Color(0xFFFF502E),
        centerTitle: true,
      ),
      body: Container(
        padding: const EdgeInsets.all(0.5),
        child: GridView(
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 3,
              mainAxisSpacing: 2.0,
              crossAxisSpacing: 2.0,
              childAspectRatio: 0.8),
          children: <Widget>[
            Image.network(
              'http://img5.mtime.cn/mt/2021/05/20/095433.63004237_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/06/02/143209.21788331_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/05/28/154438.55888452_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/04/14/100352.99938324_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/02/08/152607.91240372_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/03/22/084751.36021529_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/05/20/101203.43227335_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/03/31/083532.87179906_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2020/07/21/153448.87663608_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2020/12/29/115029.15343635_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/03/29/112302.22833044_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/06/08/165332.51721837_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/05/20/095433.63004237_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/04/14/100352.99938324_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            Image.network(
              'http://img5.mtime.cn/mt/2021/02/08/152607.91240372_1280X720X2.jpg',
              fit: BoxFit.cover,
            ),
            // FlatButton(
            //   onPressed: () {},
            //   child: Text(
            //     "返回",
            //     style: TextStyle(color: Colors.lightBlue),
            //   ),
            // ),
          ],
        ),
      ),
    );
  }
}

class EditPassword extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.0,
        title: Text(
          '修改密码',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Color(0xFFFF502E),
        centerTitle: true,
      ),
      body: Center(
        child: ForgetPassword(),
      ),
    );
  }
}

class ForgetPassword extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    //Scaffold是Material中主要的布局组件.
    return new Scaffold(
      body: ListView(
        children: <Widget>[
          Container(
            child: Image.asset(
              'image/yhb.png',
              height: 100.0,
            ),
            padding: const EdgeInsets.only(top: 50.0, bottom: 20.0),
          ),
          Padding(padding: EdgeInsets.only(top: 20.0)),
          Stack(
            children: <Widget>[
              TextField(
                keyboardType: TextInputType.phone,
                maxLines: 1,
                autofocus: false,
                cursorColor: Colors.blue,
                maxLength: 11,
                // maxLengthEnforced: true,
                // focusNode: phoneFocusNode,
                decoration: InputDecoration(
                  hintText: "请输入手机号码",
                  labelText: "手机号",
                  prefixIcon: Icon(Icons.phone),
                  // 未获得焦点下划线设为灰色
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.grey),
                  ),
                  //获得焦点下划线设为蓝色
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.blue),
                  ),
                ),
              ),
              Positioned(
                child: FlatButton(
                  onPressed: () {},
                  child: Text(
                    '发送验证码',
                    style: TextStyle(
                      color: Color(0xFFFF502E),
                    ),
                  ),
                ),
                top: 15.0,
                right: 15.0,
              )
            ],
          ),
          TextField(
            keyboardType: TextInputType.text,
            obscureText: true,
            maxLines: 1,
            autofocus: false,
            cursorColor: Colors.blue,
            // focusNode: passwordFocusNode,
            maxLength: 6,
            decoration: InputDecoration(
              hintText: "请输入新密码",
              labelText: "新密码",
              prefixIcon: Icon(Icons.vpn_key),
              // 未获得焦点下划线设为灰色
              enabledBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.grey),
              ),
              //获得焦点下划线设为蓝色
              focusedBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.blue),
              ),
            ),
          ),
          TextField(
            keyboardType: TextInputType.text,
            obscureText: true,
            maxLines: 1,
            autofocus: false,
            cursorColor: Colors.blue,
            // focusNode: passwordFocusNode,
            maxLength: 6,
            decoration: InputDecoration(
              hintText: "请输入验证码",
              labelText: "验证码",
              prefixIcon: Icon(Icons.vpn_key),
              // 未获得焦点下划线设为灰色
              enabledBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.grey),
              ),
              //获得焦点下划线设为蓝色
              focusedBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.blue),
              ),
            ),
          ),
          Padding(
            padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
            child: FlatButton(
              color: Colors.red,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              child: Text("确认修改"),
              // shape: RoundedRectangleBorder(
              //     borderRadius: BorderRadius.circular(20.0)),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => new SecondScreen(),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}
